#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
	int m, n, tmp, i, ans1, ans2;
	cin >> m >> n;
	if (m > n) { tmp = m; m = n; n = tmp; }
	for (i = 1; i <= m; i++)
	{
		if (m%i == 0 && n%i == 0)ans1 = i;
	}
	ans2 = m*n / ans1;
	cout << ans1 << " " << ans2 << endl;
	return 0;
}